package de.compu_ware.vokabeltrainer;

import java.io.Serializable;

public class Kapitel implements Comparable<Kapitel>, Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -1002898814710413985L;
	
	private long id;
	private String name;
	
	public Kapitel(String name) {
		this(0, name);
	}

	public Kapitel(long id, String name) {
		this.name = name.trim();
		this.id = id;
	}

	public String getName(){
		return name;
	}

	public long getId(){
		return id;
	}

	public void setName(String name){
		if (!name.trim().equals("")) {
			this.name = name.trim();
		}
	}

	public void setId(long kap_id){
		id = kap_id;
	}

	@Override
	public int compareTo(Kapitel another) {
		return this.name.compareTo(another.getName());
	}
	
}
